Why does this DB crash doors?

Below is a very simple script (I've extracted the key bits that reproduce my problem; tossed the rest).

On DOORS 8.1 this crashes DOORS. I must be doing something dumb, but I can't see it.
Anyone sport the problem with this?
(See script below, along with all the diagnostic output.)

Regards, Strathglass

//SCRIPT:
//-------------------------------------------------------

DB dbGetTarget
DBE dbeOpts //for a choice() DBE
DBE dbeOK //for an OK button

string modName

const int optsCount=9
string optsoptsCount

void doTargetOK(DB dbGetTarget)
{
int i=get(dbeOpts)
modName=opts[i]
}

//=====================================================

modName=""
opts[0]="Mod1"
opts[1]="Mod2"
optsCount=2

dbGetTarget=create("Target Module Selection")
dbeOpts=choice(dbGetTarget,"Specify Your Choice: ",opts,optsCount,60,true)
dbeOK=ok(dbGetTarget,"OK",doTargetOK)
block(dbGetTarget)
if (modName=="") { errorBox "NO VALID MODULE!"; halt }

print "choice is " modName "\n"

// END OF SCRIPT



HERE IS WHAT HAPPENS IN DOORS:

*The expected dialog box does pop up and appears OK.
*A "DOORS report" window pops up saying "DXL halted with runt-time error".
*The DXL interaction window shows this output (line 26 is the block() call):
-R-E- DXL: <Line:26> An unexpected error has occurred: doors.exe caused an EXCEPTION_ACCESS_VIOLATION in module kernel32.dll at 001B:7C83101A

-I- DXL: execution halted

*Finally, I get the following diagnostic log window output:
DOORS: **** Translating a structured exception ****
DOORS: Version 8.1.0.8, build number 81119, built on Jul 26 2007 13:36:17.
DOORS: Whistler Workstation Service Pack 2 (Build 2600)

DOORS: DOORS: 81 percent of memory is in use.
DOORS: There are 1039856 total Kbytes of physical memory.
DOORS: There are 194860 free Kbytes of physical memory.
DOORS: There are 3193032 total Kbytes of paging file.
DOORS: There are 1697572 free Kbytes of paging file.
DOORS: There are 1fff80 total Kbytes of virtual memory.
DOORS: There are 1e1078 free Kbytes of virtual memory.

DOORS: argv[0]: C:\Program Files\Telelogic\DOORS_8.1\bin\doors.exe
DOORS: doors.exe caused an EXCEPTION_ACCESS_VIOLATION in module kernel32.dll at 001B:7C83101A
DOORS: 001B:7C83101A (0x0000FDE9 0x00000000 0x87654321 0xFFFFFFFF) kernel32.dll
DOORS: 001B:7C830F8F (0x0000FDE9 0x00000000 0x87654321 0xFFFFFFFF) kernel32.dll
DOORS: 001B:005947B8 (0x87654321 0xFFFFFFFF 0x0000FDE9 0x006C2470) doors.exe
DOORS: 001B:00594847 (0x00850714 0x00000143 0x00000000 0x87654321) doors.exe
DOORS: 001B:006D0162 (0x024E7390 0x00000002 0x87654321 0x00000000) doors.exe
DOORS: 001B:006D0136 (0x00000001 0x024E3730 0x00994947 0x024E3730) doors.exe
DOORS: 001B:009750F7 (0x01455BE0 0x03A11038 0x0012F7B8 0x00000000) doors.exe
DOORS: 001B:007AE64A (0x00000000 0x00000000 0x00000000 0x00000000) doors.exe
DOORS: **** end of event ****
strathglass - Wed Apr 01 14:01:16 EDT 2009

Re: Why does this DB crash doors?
strathglass - Wed Apr 01 14:04:59 EDT 2009

After the optsCount declaration, the next line should read:
string opts OPENING SQUARE BRACKET optsCount CLOSING SQUARE BRACKET

Wonder if it shows correctly if I escape the square brackets with backslashes:
string opts[optsCount]

-Strathglass

Re: Why does this DB crash doors? [ANSWER FOUND]
strathglass - Wed Apr 01 14:38:24 EDT 2009

As expected, it was something dumb:
the choice() DBE setup line was missing an argument, and so the width became the default choice, and was an invalid choice at that, hence the crash!!

Regards, Strathglass.